syntax = "proto3";

package kuma.mesh.v1alpha1;

option go_package = "github.com/kumahq/kuma/api/mesh/v1alpha1";

import "api/mesh/options.proto";
import "api/mesh/v1alpha1/selector.proto";
import "kuma-doc/config.proto";

option (doc.config) = {
  type : Policy,
  name : "TrafficTrace",
  file_name : "traffic-trace"
};

// TrafficTrace defines trace configuration for selected dataplanes.
message TrafficTrace {

  option (kuma.mesh.resource).name = "TrafficTraceResource";
  option (kuma.mesh.resource).type = "TrafficTrace";
  option (kuma.mesh.resource).package = "mesh";
  option (kuma.mesh.resource).kds.send_to_zone = true;
  option (kuma.mesh.resource).ws.name = "traffic-trace";
  option (kuma.mesh.resource).allow_to_inspect = true;

  // List of selectors to match dataplanes.
  repeated Selector selectors = 1 [ (doc.required) = true ];

  // Configuration defines settings of the tracing.
  message Conf {
    // Backend defined in the Mesh entity.
    string backend = 1;
  }

  // Configuration of the tracing.
  Conf conf = 3;
}
